Methods for improved autofocus in digital imaging systems

ABSTRACT

Methods to improve autofocus in digital imaging systems, such as digital cameras, are disclosed. Embodiments may include, in response to locking of lens focus on a subject image, determining an initial subject focus distance and an initial attitude, and in response to a request for an exposure, determining a final attitude. Embodiments may also include determining a final target subject distance based on the initial subject focus distance and a focus correction distance, where the focus correction distance is based on the difference between the initial attitude and the final attitude. Embodiments may also include focusing the lens at the final target subject distance. Further embodiments may include after focusing the lens at the final target subject distance, exposing an image. Other embodiments may include determining the initial and final attitude with a micro-electro-mechanical (MEMS)-based sensor or other sensor.

FIELD OF INVENTION

The present invention is in the field of digital imaging systems and, inparticular, to systems and methods for improved autofocus in digitalimaging systems such as digital cameras.

BACKGROUND

Digital imaging systems such as digital cameras continue to increase inpopularity, providing users with the ability to capture images (i.e.,take photographs) with relative ease. Digital imaging systems typicallyinclude a lens for directing the light comprising a digital imagethrough a light path to an optical sensor array. Autofocus systems (aswell as other automations such as automatic exposure or flash) are oftenan important part of digital imaging systems as they improve the userexperience by making such systems easier to use. Whether an object in animage is ‘in focus’ (i.e., at the sharpest possible setting) for adigital imaging system depends on a number of factors, including thedistance between the lens and the sensor array, the lens focal length,exposure aperture, and the distance to the subject. As subject distancecan effect whether an object is in focus, some objects in an image maybe ‘in focus’ while other objects may be ‘out of focus’. Autofocussystems typically include a focusing motor that moves a portion of thelens of the digital imaging system in and out until the sharpestpossible image of the desired subject is projected onto the opticalsensor array. In manual focus systems, a user would turn a focusing ringon the lens until the image (or portion of an image) in the viewfinderappeared in focus.

Autofocus systems typically rely on active autofocus, passive autofocus,or a combination of the two, and utilize one or more autofocus sensorswithin the field of view. Active autofocus systems measure the distanceto the subject (using, for example, sound or infrared signals) andadjust focus of the optical system accordingly. Passive systems analyzethe incoming image itself and drive the lens back and forth searchingfor the best focus and can include both phase detection systems andcontrast measurement systems. Complicated autofocus systems with manysensors can add significant cost and complexity to a digital imagingsystem, as autofocus sensors are relatively expensive and more accuratesensors (e.g., horizontal and vertical capability) are more expensivestill. In all but the most expensive digital single-lens-reflex (DSLR)camera, there will typically be only a few autofocus sensors within theuser's field of view. Because autofocus sensors do not completely coverthe field of view, the subject that the user desires to be in focus maynot lie beneath an autofocus sensor, making it difficult to focus on thesubject. In this case, users typically rotate the camera until anautofocus point (typically the center autofocus sensor, as it is usuallythe most accurate) falls over the area of interest and then lock thefocus. After locking the focus, the user then may recompose with thesubject at the desired location in the frame and then take the exposure.

The solution of locking the autofocus and recomposing often providesunacceptable results, however, when the depth-of-focus (DOF) is smallcompared to the difference in subject distance between the scenecomposed as desired as the scene composed during focus lock. A usertaking a portrait (where a very small DOF created by large apertures isoften aesthetically desirable), for example, might lock focus on thesubject's eyes but when the user recomposes, the plane of focus would bebehind the eyes. Thus, if the DOF is too small the subject's eyes becomeout-of-focus and an undesirable photograph results. The DOF may varydepending on imaging sensor size, imaging lens focal length, exposureaperture, and subject distance. For close subject distances and/or largeexposure apertures with small DOF, the problem is exacerbated andunacceptable focus shifts are introduced. There is, therefore, a needfor an effective system to provide improved autofocus for digitalimaging systems.

SUMMARY OF THE INVENTION

The problems identified above are in large part addressed by thedisclosed systems and methods for improved autofocus in digital imagingsystems. Embodiments may include, in response to locking of lens focuson a subject image, determining an initial subject focus distance and aninitial attitude, and in response to a request for an exposure,determining a final attitude. Embodiments may also include determining afinal target subject distance based on the initial subject focusdistance and a focus correction distance, where the focus correctiondistance is based on the difference between the initial attitude and thefinal attitude. Embodiments may also include focusing the lens at thefinal target subject distance. Further embodiments may include afterfocusing the lens at the final target subject distance, exposing animage.

A further embodiment provides a digital imaging system having a userinterface module to receive focus lock commands and exposure commandsfrom a user and an image capture module to generate a digital image. Thesystem may also include an autofocus system module to automaticallyfocus a lens, where the autofocus system module has a primary autofocussystem to determine whether a lens is in focus. The autofocus systemmodule may also have an attitude sensor interface to receive anindication of an initial attitude in response to a focus lock commandand a final attitude in response to an exposure command. The autofocussystem module may further include an autofocus correction module todetermine a focus correction distance based on the initial attitude andthe final attitude, where the primary autofocus system corrects lensfocus based on the focus correction distance before an exposure is made.

A further embodiment provides a digital imaging system having a housing,a processor within the housing to control operation of the digitalimaging system, an autofocus system, and an optical sensor array withinthe housing and in communication with the processor, where the opticalsensor array generates an image in response to light. The system furthermay include an attitude sensor to determine an initial attitude inresponse to a focus lock command and a final attitude in response to ashutter release command. The processor of the system may determine afocus correction distance based on difference between the initialattitude and the final attitude and may modify focus based on the focuscorrection distance. In a further embodiment, the attitude sensor may bea micro-electro-mechanical (MEMS)-based sensor.

BRIEF DESCRIPTION OF THE DRAWINGS

Advantages of the invention will become apparent upon reading thefollowing detailed description and upon reference to the accompanyingdrawings in which, like references may indicate similar elements:

FIG. 1 depicts an environment for a digital imaging system with anautofocus system and an attitude sensor according to one embodiment;

FIG. 2 depicts a block diagram of a digital camera suitable for use asthe digital imaging system of FIG. 1 according to one embodiment;

FIG. 3 depicts a conceptual illustration of software components of adigital imaging system such as a digital camera according to oneembodiment; and

FIG. 4 depicts an example of a flow chart for correcting focus based ona change in attitude according to one embodiment.

DETAILED DESCRIPTION OF EMBODIMENTS

The following is a detailed description of example embodiments of theinvention depicted in the accompanying drawings. The example embodimentsare in such detail as to clearly communicate the invention. However, theamount of detail offered is not intended to limit the anticipatedvariations of embodiments; on the contrary, the intention is to coverall modifications, equivalents, and alternatives falling within thespirit and scope of the present invention as defined by the appendedclaims. The descriptions below are designed to make such embodimentsobvious to a person of ordinary skill in the art.

Generally speaking, systems and methods to improve autofocus in digitalimaging systems, such as digital cameras, are disclosed. Embodiments mayinclude, in response to locking of lens focus on a subject image,determining an initial subject focus distance and an initial attitude,and in response to a request for an exposure, determining a finalattitude. Attitude, as described in more detail subsequently, mayrepresent the orientation in space of an object with respect to definedaxes. Embodiments may also include determining a final target subjectdistance based on the initial subject focus distance and a focuscorrection distance, where the focus correction distance is based on thedifference between the initial attitude and the final attitude.Embodiments may also include focusing the lens at the final targetsubject distance. Further embodiments may include after focusing thelens at the final target subject distance, exposing an image. Otherembodiments may include determining the initial and final attitude witha micro-electro-mechanical (MEMS)-based sensor or other sensor.

The system and methodology of the disclosed embodiments provides animproved method of determining autofocus of a digital imaging systemsuch as a digital camera. Using a sensor such as a MEMS-based sensor,the system may determine an initial attitude when a user selects focuslock and a final attitude after a user recomposes an image and attemptsto take an exposure. The attitude of an object may represent itsorientation in space comprising the yaw, pitch, and roll of that objectwith respect to defined axes. The change in attitude of an object mayrepresent its combined angular rotation in yaw, pitch, and roll withrespect to defined axes. The disclosed system may advantageously providea correction to the autofocus based on the difference between theinitial attitude and the final attitude (i.e., the change in attitude)to correct for a change in distance resulting from rotation of thedigital imaging system. A user focusing on one part of an image, such asan important object like a portrait subject's eyes, may select focuslock and recompose the image. Previous systems resulted in the potentialfor the initial subject to be out of focus after recomposition becausein the change of distance resulting from rotation of the imaging system.The disclosed system advantageously provides for a corrected focusdistance so that the initial subject (i.e., the subject's eyes) will bein focus. The disclosed system may be particularly useful where thedepth-of-focus is small or shallow, such as with large apertures.

While specific embodiments will be described below with reference toparticular configurations of hardware and/or software, those of skill inthe art will realize that embodiments of the present invention mayadvantageously be implemented with other substantially equivalenthardware and/or software systems. Aspects of the invention describedherein may be stored or distributed on computer-readable media,including magnetic and optically readable and removable computer disks,as well as distributed electronically over the Internet or over othernetworks, including wireless networks. Data structures and transmissionof data (including wireless transmission) particular to aspects of theinvention are also encompassed within the scope of the invention.

Turning now to the drawings, FIG. 1 depicts an environment for a digitalimaging system with an autofocus system and an attitude sensor accordingto one embodiment. In the depicted embodiment, the digital imagingsystem 100 includes a camera housing 102, a lens 104 with an optionalmanual focus ring 106, an attitude sensor 108, and an autofocus system110. The digital imaging system 100 of the depicted embodiment ispointing towards an initial subject 112. The digital imaging system 100may in some embodiments be a digital camera such as a digitalsingle-lens-reflex (DSLR) (either fixed-lens DSLR orinterchangeable-lens DSLR), digital rangefinder camera, digitalpoint-and-shoot (P&S) camera, or fixed-lens digital camera. The digitalimaging system 100 may alternatively be an imaging device integratedwith another system, such as a mobile phone, personal digital assistant(PDA), wearable device, or mobile computer. In another alternativeembodiment, the digital imaging system 100 may be a digital camcorder,digital video camera, or other digital video-recording device.

A user may point the digital imaging system 100 in the direction of asubject in order to take a picture of that subject. To take a picture,light enters through lens 104 and is directed through a light path untilit strikes an optical sensor array (described in relation to FIG. 2),whereupon the optical sensor array captures the image. Some digitalimaging systems 100 have a single lens while others may have separatelenses for composition and taking. For example, in a DSLR digitalimaging system 100 a single lens 104 is used for both viewing an objectof interest and for capturing and directing light towards the opticalsensor array. Any lenses 104 may also be permanently attached to thecamera housing 102 (such as in the case of P&S camera) or may bedetachable and interchangeable (such as in the case ofinterchangeable-lens DSLRs). Lens 104 may also include a manual focusring 106 to provide an alternative to the autofocus system 110 of thedigital imaging system 100 or to provide fine tuning of the focus.

As described previously, whether an object in an image is ‘in-focus’(i.e., at the sharpest possible setting) depends on a number of factors,including the distance between the lens 104 and the optical sensorarray, the lens focal length, exposure aperture, and the distance to thesubject. As subject distance can affect whether an object is in focus,some objects in an image may be in focus while other objects may be outof focus. Autofocus systems 110 typically include a focusing motor thatmoves a portion of the lens 104 of the digital imaging system 100 in andout until the sharpest possible image of the desired subject isprojected onto the optical sensor array. Autofocus systems 110 rely onone or more autofocus sensors within the user's field of view in orderto determine whether or not objects ‘under’ the sensors are in focus.Autofocus systems 110 often determine a distance to the subject as partof their internal algorithms.

The digital imaging system 100 may also include one or more attitudesensors 108, which may be located within camera housing 102 in someembodiments. An attitude sensor 108 may determine the attitude of thedigital imaging system 100 with respect to defined yaw, pitch, and rollaxes. In some embodiments, the attitude sensor 108 may be amicro-electro-mechanical (MEMS)-based attitude sensor which measures theorientation of the digital imaging system 100 with respect to theearth's gravimetric field to determine the digital imaging system's 100three-dimensional attitude in space. MEMS-based attitude sensors mayprovide a relatively low-cost, reliable, and compact methodology ofdetermining rotational position when compared to other sensors. Manyexisting digital cameras include a MEMS-based orientation sensor orother orientation sensor to determine whether a photograph was taken ina landscape mode (i.e., horizontal) or portrait mode (i.e., vertical).In some embodiments, these existing orientation sensors are insufficientfor a digital imaging system 100 according to the present invention.Existing orientation sensors, for example, are limited to measuringrotation of the camera about an axis parallel to the lens so that adetermination may be made with respect to landscape or portraitorientation. Moreover, existing orientation sensors may not have theaccuracy required of the disclosed embodiments as they only requireaccuracy sufficient to distinguish between landscape and portrait modes.In other embodiments, however, attitude sensor 108 may also have thecapability of distinguishing landscape and portrait modes, eliminatingthe need for two sensors. In another alternative embodiment, theattitude sensor 108 may be another type of sensor capable of detectingthree-dimensional attitude in space, such as a gyroscope or inertialmeasurement unit (IMU).

The autofocus system 110 may utilize active autofocus, passiveautofocus, or a combination of the two. Active autofocus systems measurethe distance to the subject (using, for example, sound or infraredsignals) and adjust focus of the optical system accordingly. Passivesystems analyze the incoming image itself and drive the lens 104 backand forth searching for the best focus. Passive autofocus systems caninclude both phase detection systems and contrast measurement systems.Phase detection autofocus systems divide the incoming light toparticular autofocus sensors into pairs of images and then compare theresulting images to determine the proper focus. Some contrast-basedpassive autofocus systems utilize an autofocus sensor such as acharge-coupled device (CCD) that provides input to algorithms to computethe contrast of the actual image elements. A CCD sensor typically has agroup of pixels and an on-board processor analyzes the light hitting thesensor by looking at the difference in intensity among the adjacentpixels. As an out-of-focus scene has adjacent pixels with similarintensities, the processor may move the lens 104 and attempt to find themaximum intensity difference between adjacent pixels. The point ofmaximum intensity difference between pixels is then the point of bestfocus. Autofocus systems may use a combination of different autofocussensors and methods, such as a camera that utilizes a passive phasedetection system with an autofocus ‘assist’ from an active autofocussystem. In some embodiments, the autofocus sensor 110 may determinedistance to the subject as part of its determination of proper focus.

In previous systems, locking focus on one subject and then recomposingcould result in undesirable focusing errors in certain situations. Forexample, a user may point the lens 104 of the digital imaging system 100at an initial subject 112 such as a Christmas tree with a star on top asdepicted in FIG. 1. The user may wish to center their focus (but nottheir composition) on the star of the tree, pointing the lens 104 of thedigital camera system 100 along the line ‘A2’ as depicted in FIG. 1.Once the star is ‘underneath’ an autofocus sensor, the autofocus system110 of the digital imaging system 100 may then automatically focus onthe star. The user may then actuate focus lock by, for example,partially depressing the shutter-release button or actuating a focuslock button on the outside of the camera housing 102 to lock the lensfocus in its current position. By doing so, the user is attempting toplace the center of the plane of focus along line ‘A1’ of FIG. 1,centered on the star. The user may then recompose their image byrotating the digital imaging system 100 and pointing the lens 104 alongline ‘B2’ as depicted in FIG. 1 while the lens focus remains locked, andthen taking the photograph once recomposition is complete. The plane offocus for the lens 104, however, will no longer be centered on the starbecause of the angular rotation of the lens 104 and digital imagingsystem 100. The plane of focus for the lens 104 will instead be centeredalong line ‘B1’ of FIG. 1, behind the star, because of the locked lensfocus, instead of along ‘A1’ where the user desires. With a sufficientlysmall DOF resulting from the digital imaging system 100 configurationand subject distance, the star may then become out of focus when theuser takes the photograph after recomposing. As described previously,the DOF may vary depending on imaging sensor size, imaging lens focallength, exposure aperture, and subject distance. The autofocus error maybe exacerbated when the DOF is small, such as when the subject distanceis relatively short or the exposure aperture is relatively large.

Using the system of the disclosed system, the autofocus performance ofdigital imaging system 100 in certain situations may be improved bycorrecting for the error caused by rotation (i.e., change in attitude)of the digital imaging system 100 after focus lock. As will be describedin more detail subsequently, the attitude sensor 108 may determine theattitude of the digital imaging system 100 both at the time of focuslock (digital imaging system 100 oriented along line ‘A2’ ) and when aphotograph is taken (digital imaging system 100 oriented along line‘B2’). The difference between these two attitudes is the angle ‘θ’depicted in FIG. 1. Using the calculated angle ‘θ’ and a measurement ofthe distance along line ‘A2’ when focus was locked (as described in moredetail in relation to FIG. 4), the autofocus system 110 may calculate afocus correction distance and correct the focus before the exposure istaken. The focus correction distance may effectively be the distancebetween lines ‘A1’ and ‘B1’. By correcting the focus in this matter, thedigital imaging system 100 provides more accurate focus that isconsistent with a user's intentions. The digital imaging system 100 maythus change the plane of focus from line ‘B1’ to line ‘A1’ so that thesubject selected at focus lock (i.e., the star) is ‘in focus’ in thefinal exposure.

FIG. 2 depicts a block diagram of a digital camera 200 suitable for useas the digital imaging system 100 of FIG. 1 according to one embodiment.The digital camera 200 of the depicted embodiment includes a processor202 in connected to storage 204, memory 206, an optical sensor array208, an I/O driver/controller 210, and an autofocus system 110.Processor 202 may include one or more system central processing units(CPUs) or processors to execute instructions. Storage 204 may includestorage devices for storing digital images captured by the digitalcamera 200, such as removable media such as a microdrive or flash mediadevices such as a Secure Digital (SD)™ card (as defined by the SD CardAssociation), a CompactFlash® (CF) card, or a Memory Stick. Storage 204may also include non-removable media such as hard drives or on-boardnon-volatile memory. Memory 206 may include read-only memory (ROM),random access memory (RAM), or other types of memory (or combinationsthereof) containing a plurality of executable instructions which, whenexecuted on processor 202, control the operation of the digital camera200. The optical sensor array 208 may capture a digital image whenexposed to light through lens 104 and store the image in storage 204.

The I/O driver/controller 210 may facilitate communications betweenprocessor 202 and other components of the digital camera 200, includinguser input devices and other hardware items. In the depicted embodiment,the digital camera 200 includes two input devices, the shutter releasebutton 212 and the focus lock button 214. A user may actuate the shutterrelease button 212 to take a photograph (i.e., to request the digitalcamera 200 to expose the optical sensor array 208 to light for aspecified timeframe). A user may actuate the optional focus lock button214 whenever they wish to lock focus at its current position. By lockingfocus with the focus lock button 214, a user may then recompose withouthaving the autofocus modify their desired point of focus. In otherembodiments, the user may achieve focus lock (and/or exposure lock) bypartially depressing the shutter release button 212, eliminating theneed for the focus lock button 214. In these embodiments, fullydepressing the shutter release button 212 will take an exposure. Oneskilled in the art will recognize that digital camera 200 may containother user-actuated switches or buttons, such as playback buttons ormanual focus rings 106.

The I/O driver/controller 210 may also facilitate communications betweenprocessor 202 and other hardware items, such as a focusing motor 216,autofocus sensors 218, and the attitude sensor 108. The focusing motor216 may be an electromechanical or other type of motor that drives thelens forward or backward or causes other changes in the physical stateof the lens to adjust the focus of the lens, such as by changing thedistance between optical elements within the lens. The processor 202,based on commands from the autofocus system 110, may command thedirection and speed of the focusing motor 216. The autofocus sensors 218may be, for example, CCD sensors that look at the difference inintensity among the adjacent pixels to provide input to algorithms tocompute the contrast of the actual image elements. The I/Odriver/controller 210 may also facilitate communication with otherhardware items, such as the lens 104, a shutter (if utilized), LCDdisplay, external ports, mirrors, etc.

The autofocus system 110 may be in communication with the processor 202to receive input from the user input devices and other hardware as wellas to send commands to the hardware devices. The autofocus system 110may, for example, receive input from the shutter release button 212 andfocus lock button 214 in order to respond to user commands. Theautofocus system 110 may also receive information from the autofocussensors 218 and attitude sensor 108 that it uses to determine the properfocus. The autofocus system 110 may also receive status information(e.g., current location) from the focusing motor 216 and send commandsto the focusing motor 216 to extend, retract, etc.

FIG. 3 depicts a conceptual illustration of software components of adigital imaging system 100 such as a digital camera 200 according to oneembodiment. The digital imaging system 100 of the depicted embodimentincludes a user interface module 302, an image capture module 304, andan autofocus system module 306. The user interface module 302 mayreceive input from a user, such as actuations of a shutter releasebutton 212 or focus lock button 214, as well as provide output to a uservia an LCD display or other output device (e.g., audio device). Theimage capture module 304 may process the image recorded by the opticalsensor array 208, including any noise reduction, sharpening, changes tocolor or saturation, changing image formats, saving the image to thestorage 204, or any other task.

The autofocus system module 306 may control the autofocus system 110 andmay include sub-modules such as a primary autofocus system 308, afocusing motor controller 310, an autofocus correction module 312, andan attitude sensor interface 314. The primary autofocus system 308 mayreceive inputs from the autofocus sensors 218 to determine whether ornot the image underneath the autofocus sensors is in focus, as is knownin the art. The primary autofocus system 308 may also produce commandsto the focusing motor controller 310 for transmittal to the focusingmotor 216. Feedback from the focusing motor 216 may also be received bythe focusing motor controller 310 and utilized by the primary autofocussystem 308. The autofocus correction module 312 may determine a focuscorrection factor based on attitude sensor 108 information received fromthe attitude sensor interface 314 and based on distance informationdetermined by the primary autofocus system 308. As will be described inmore detail in relation to FIG. 4, the autofocus correction module 312may correct for focusing errors resulting in the rotation of a digitalimaging system 100 after focus lock has been requested. The attitudesensor interface 314 may provide for interaction between the autofocussystem module 306 and the attitude sensor 108 and may optionally performprocessing on data received from the attitude sensor 108.

FIG. 4 depicts an example of a flow chart 400 for correcting focus basedon a change in attitude according to one embodiment. The method of flowchart 400 may be performed, in one embodiment, by components of adigital imaging system 100 and, in particular, the autofocus systemmodule 306 and its sub-modules. Flow chart 400 begins with optionalelement 402, where the autofocus system module 306 activates autofocuscorrection according to embodiments of the present invention. In someembodiments, the autofocus system module 306 may activate autofocuscorrection in response to a request via a user who inputs the requestvia a button or entry in a control menu of a LCD display. In otherembodiments, the autofocus system module 306 may activate the autofocuscorrection based on default settings or other means (e.g., autofocuscorrection automatically on). Once autofocus correction is initiated,the primary autofocus system 308 of the autofocus system module 306 maydetermine at decision block 404 when a user has locked the focus, suchas by actuating the focus lock button 214 or partially depressing theshutter release button 212. Focus lock may be requested after use of thedigital imaging system, such as when a user utilizes the autofocussystem 110 to focus on a desired subject. Once focus lock is detected,the method of flow chart 400 continues to element 406; otherwise, themethod awaits a determination that focus has been locked.

Once focus has been locked, the primary autofocus system 308 maydetermine the initial subject focus distance at element 406. The initialsubject focus distance is the distance between the digital imagingsystem 100 and the point the user selects to be the point of focus theuser locks in, as represented by distance ‘A2’ in FIG. 1. The primaryautofocus system 308 may determine the initial subject focus distanceusing any methodology, including as part of an active autofocus system(where distance measurement is part of the autofocus procedure) or basedon a passive autofocus system (where distance may be measured ordetermined as part of the autofocus algorithm). Alternatively, primaryautofocus system 308 may determine the initial subject focus distanceanother way, such as by receiving input from a differentdistance-determining device or by calculating the distance based on thelens 104 position when focused.

In addition to determining the initial subject focus distance once focushas been locked, the autofocus correction module 312 of the autofocussystem module 306 may also determine an initial attitude at element 408.The initial attitude may be the attitude of digital imaging system 100at the time when autofocus is selected. The initial attitude may, in oneexample, be the attitude of digital imaging system 100 when it ispointing along line ‘A2’ of FIG. 1. In one embodiment, the initialattitude may be measured in relation to the earth's gravimetric field,such as when measured by a MEMS-based attitude sensor 108. The referenceframe of the initial attitude may be any frame assuming that it issubstantially similar to the reference frame of the final attitudedetermined later, as the difference between the two attitudes is therelevant angle, not the particular values for each of the initial andfinal attitudes (as described subsequently) in relation to element 414.

At decision block 410, the autofocus correction module 312 may determinethat an exposure has been triggered, such as by receiving an indicationdirectly or indirectly from the actuation of a shutter release button212 by a user. If no indication of an exposure is received, the methodof flow chart 400 may wait for such indication. This may occur when theuser is recomposing their image after locking focus. Once an indicationof the exposure has occurred, the method of flow chart 400 continues toelement 412, where the autofocus correction module 312 may determine afinal attitude, similarly to the determination of element 408. The finalattitude represents the attitude of digital imaging system 100 at thetime when the exposure is triggered. The final attitude may, in oneexample, be the attitude of digital imaging system 100 when it ispointing along line ‘B2’ of FIG. 1. The autofocus correction module 312may next determine the change in angle between the initial attitude andthe final attitude at element 414. The change in angle (represented byangle ‘θ’ in FIG. 1) may represent the total angular rotation of thedigital imaging system 100 in roll, pitch, and yaw (i.e., the change inattitude) between the time when focus lock was initiated and theexposure was initiated. In some embodiments, the change in angle may bethe difference between the measured initial and final attitudes.

After the change in angle is determined, the method of flow chart 400continues to element 416, where the autofocus correction module 312 maydetermine a focus correction distance based on the change in angle. Inone embodiment, the focus correction distance may be calculated by thefollowing equation:fcd=(d*(1−cos θ))where ‘fcd’ is the focus correction distance, ‘d’ is the initial subjectfocus distance, and ‘θ’ is the change in angle. One skilled in the artwill understand that other methodologies are also possible to determinea focus correction distance based on the change in angle, such as byusing table lookups or other methodologies. After determining the focuscorrection distance, the autofocus correction module 312 may feedbackthe focus correction distance to the primary autofocus system 308 atelement 418. The primary autofocus system 308 may modify the focus pointbased on the determined focus correction distance at element 420, suchas by modifying the initial target subject distance by the focuscorrection distance to generate a final target subject distance beforean exposure is made. In one embodiment, the focus correction distancemay be subtracted from the initial target subject distance to determinethe final target subject distance. The primary autofocus system 308 maythen at element 422 command the focusing motor controller 310 to movethe focusing motor 216 the appropriate amount based on the final targetsubject distance. The digital imaging system 100 may then expose thedigital image at element 424, after which the method of flow chart 400terminates.

In general, the routines executed to implement the embodiments of theinvention, may be part of an operating system or a specific application,component, program, module, object, or sequence of instructions. Thecomputer program of the present invention typically is comprised of amultitude of instructions that will be translated by the native computerinto a machine-readable format and hence executable instructions. Also,programs are comprised of variables and data structures that eitherreside locally to the program or are found in memory or on storagedevices. In addition, various programs described hereinafter may beidentified based upon the application for which they are implemented ina specific embodiment of the invention. However, it should beappreciated that any particular program nomenclature that follows isused merely for convenience, and thus the invention should not belimited to use solely in any specific application identified and/orimplied by such nomenclature.

It will be apparent to those skilled in the art having the benefit ofthis disclosure that the present invention contemplates systems andmethods for improving autofocus in a digital imaging system. It isunderstood that the form of the invention shown and described in thedetailed description and the drawings are to be taken merely asexamples. It is intended that the following claims be interpretedbroadly to embrace all the variations of the example embodimentsdisclosed.

1. A method for autofocusing a lens of a digital imaging system, themethod comprising: in response to locking of lens focus on a subjectimage, determining an initial subject focus distance and an initialattitude; in response to a request for an exposure, determining a finalattitude; determining a final target subject distance based on theinitial subject focus distance and a focus correction distance, thefocus correction distance being based on the difference between theinitial attitude and the final attitude; and focusing the lens at thefinal target subject distance.
 2. The method of claim 1, furthercomprising activating autofocus correction.
 3. The method of claim 1,further comprising after focusing the lens at the final target subjectdistance, exposing an image.
 4. The method of claim 1, whereindetermining an initial attitude comprises determining an initialattitude with respect to the earth's gravimetric field.
 5. The method ofclaim 1, wherein determining a final attitude comprises determining afinal attitude with respect to the earth's gravimetric field.
 6. Themethod of claim 1, wherein determining a final target subject distancecomprises: determining a focus correction distance based on the initialsubject focus distance and the difference between the initial attitudeand the final attitude; and modifying the initial subject focus distanceby subtracting the determined focus correction distance to determine afinal target subject distance.
 7. The method of claim 1, whereinfocusing the lens at the final target subject distance comprises drivingthe lens a distance based on the focus correction distance.